<%@ page import="com.almori.hr.timetracker.*" import="java.io.File"%>
<% try {
        MgrDashBean m = new MgrDashBean();
        Employee me = (Employee) session.getAttribute("Employee");
        if (me.getRole() == 2) {
            File f = new File(getServletContext().getRealPath("") + "\\img\\pics\\" + me.getPic());
            String p = (f.exists()) ? me.getPic() : "auser.jpg";  // check for pic or get generic one
%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
    <head>
        <title>Timetracker Almori BPO Services - Bienvenido</title>
        <link rel="Shortcut icon" href="img/logo.png" />
        <link rel="stylesheet" type="text/css" href="css/style_mgr.css" />
        <!--[if IE 8]>
         <link rel="stylesheet" type="text/css" href="css/style_mrIE.css" />
      <![endif]-->
        <script type="text/javascript" src="http://code.jquery.com/jquery-latest.min.js"></script>
        <style type="text/css">       


            /*********************************************/
            /***********sidebar***************************/
            /*********************************************/	
            #main {
                clear: both;
                padding: 7px 18px 0px;
                /*border: solid 1px #cccccc;*/
                border: none;
                width: 944px;
                float:right;
                background: transparent url(images/bg_repeat_middle.jpg) repeat-y;
            }
            .aside {
                /*background: transparent url(images/widget_verticalscroll.png) repeat-y;*/

                width: 243px;
                margin-bottom: 9px;
            }



            .widgetcontainer{
                background: transparent url(img/sidebar_bg.png) repeat-y;
            }
            .aside h3{
                font-size: 27px;
                font-style: normal;
                margin:0 auto -13px;
                padding-top:13px;
                text-indent:13px;
                /*	text-transform:uppercase; */
                background: transparent url(img/side_hedr_empty.png) no-repeat;
                color: white;
                height: 45px;

            }

            .aside ul ul {
                margin: 0;
                padding-top: 10px;
            }

            .aside ul, .aside p{
                margin-bottom: 0;

            }


            .aside ul ul li {

                /*min-height: 50px;*/
                list-style:none;
                /*border-top:thin solid #D6D6D6;*/
                /*min-height: 3em;*/
                margin: 0 auto;
                padding: 1px 7px;
                width: 224px;
            }

            div#recent_posts_widget div.aside ul ul li {

                /*min-height: 50px;*/
                list-style:none;
                /*border-top:thin solid #D6D6D6;*/
                /*min-height: 3em;*/
                margin: 0 auto;
                padding: 1px 7px;
                width: 224px;
                height: 100%;
                min-height: 60px;
            }

            .aside ul ul li:hover{
                background: #E6F8FF;

            }

            .aside ul ul li:hover a{
                border-top: border-top:thin solid #E6F8FF;

            }

            /*.ie7 .aside ul ul li {
                    height: 3em;
                    }*/


            /*.aside ul ul li:first-child {
                    border-top: none;
            }*/

            .aside ul ul li a {
                background: transparent url(img/ico_articles.png) no-repeat top left;
                padding: 5px 0 9px 41px;
                display:block;
                /*min-height: 3em;*/
                margin: 5px 0 2px 0;
                border-top:thin solid #F0F0F0;
                cursor: pointer;
                height:100%;
            }

            div#recent_posts_widget  ul ul li a {	
                display:block;	
                background: none;	
                margin: 5px 0 2px 0;
                border-top:thin solid #F0F0F0;
                padding: 5px 0 9px 0;
                height:100%;
                min-height: 60px;	
            }



            .aside ul ul li:first-child a{
                border-top:none;

            }

            #recent_posts_widget ul ul li{
                margin-bottom: -2px;
                /*background: transparent url(images/side_hedr_recent.png) no-repeat;
                background: transparent url(images/side_hedr_empty.png) no-repeat;*/

                /*text-indent:-999px;*/
            }

            .recent_title{float: right; min-height: 70px; width: 144px; padding: 0 0 0 10px;}
            .recent_image{width: 70px; height: 70 px; float: left;}
            .attachment-Recent-Posts{  float: left;}

            /*#recent_posts_widget ul ul li a{
                    padding: 5px 0 9px 41px;	
            }*/


            /*#tools_widget h3 {
                    width: 243px;
                    height:45px;
                    
            }*/
            /*#aec_upcoming_events-3 h3 {
                    width: 243px;
                    height:45px;	
            }*/

            #tools_widget {
                /*background: transparent url(images/widget_verticalscroll.png) repeat-y;*/
                background: transparent url(img/sidebar_bg.png) repeat-y;
                /*margin-top: 20px;*/

            }


            #tools_widget .widget_footer, .tools_widget .widget_footer {
                /*background: transparent url(images/widget_verticalscroll.png) repeat-y;
                
                
                margin-top: 247px;*/
                margin-bottom: 10px;

            }



            .ie7 #tools_widget .widget_footer, .ie7 .tools_widget .widget_footer {
                /*background: transparent url(images/widget_verticalscroll.png) repeat-y;*/
                margin-top: -5px;	
                clear: none; 

            }




            .widget_footer {
                width: 243px;
                height:8px;
                background: transparent url(img/side_outline_botm.png) no-repeat center center;
                margin:0 auto 9px;/*text-indent:-999px;*/
                float:left;
                clear: both;
            }
            #menu-tools {
                width: 244px;
                margin: 0 auto;
                padding: 0;
            }
            #menu-tools li {
                line-height: 48px;
                /*height: 33px;*/
                /*border-top:thin solid #D6D6D6;*/
                padding: 0 7px;
                width: 224px;
                margin: 0 auto;
                clear: both;
            }
            #menu-tools li:hover {

                background: #E6F8FF;



            }
            #menu-tools li:hover a{
                border-top: border-top:thin solid #E6F8FF;

            }


            /*#menu-tools li:first-child {
                    border-top: none;
            }*/
            #menu-tools li:first-child a {
                border-top: none;
                display: block;
                padding-left: 41px;
                /*text-transform:uppercase;*/
                border-top:thin solid  #F0F0F0;
            }
            #menu-tools li a {
                /*line-height: 33px;
                        height: 100%;
                        width: 100%;
                        padding:7.5px 0 7.5px 33px;*/
                display: block;
                padding-left: 41px;
                /*text-transform:uppercase;*/
                border-top:thin solid  #F0F0F0;
            }

            .upcoming_events {
                width: 230px;
                margin:0 auto !important;
            }


            #todays_lunch li:hover, #todays_lunch div:hover, #todays_lunch ul:hover{
                background: none;
                cursor: default;	
            }

            #todays_lunch a:hover{
                color: #666666;	
                cursor: default;	
            }

            li#todays_lunch p span, li#todays_lunch p{ font-size: 13px !important; font-family: Arial,sans-serif !important; }


            #menu-item-265 a {
                background: transparent url(img/search-small.png) no-repeat center left;   
            }

            .ie7 #menu-item-265, .ie7 #menu-item-266, .ie7 #menu-item-267, .ie7 #menu-item-268, .ie7 #menu-item-955 {
                /* line-height: 42px; */
            }
            #menu-item-266 a {
                background: transparent url(img/admon-small.png) no-repeat center left; 
            }

            #menu-item-266{
                line-height: 49px !important;
            }

            #menu-item-266:hover ul.sub-menu{
                display:block;
                visibility:visible;
            }

            #menu-item-266 ul.sub-menu{
                display: none;
                visibility: hidden;
                float:none;
                position: absolute;
                background: white;
                z-index: 2000;
                right: 260px;
                width: 224px;
                padding-top: 0px;
                top: 142px;
                border: thin solid #F0F0F0;
                border-width: 0 1px 1px 1px;
            }

            .ie7 #menu-item-266 ul.sub-menu, .ie8 #menu-item-266 ul.sub-menu{
                top: 144px;
            }

            #menu-item-266 ul.sub-menu li{
                background: none;
                padding: 0 0 0 0;
            }

            #menu-item-266 ul.sub-menu li:hover{
                background: #E6F8FF;

            }

            #menu-item-266:hover ul.sub-menu li a{
                background: none;
                padding: 0 0 0 13px;
                margin: 0 0 0 0;
            }



            #menu-item-267 a {
                background: transparent url(img/admon-small.png) no-repeat center left;
            }
            #menu-item-268 a {
                background: transparent url(img/csv-small.png) no-repeat left 58%;
            }

            #menu-item-268{
                line-height: 49px !important;
            }

            #menu-item-955 a {
                background: transparent url(img/report-small.png) no-repeat left 48%;
            }

            .ie7 #menu-item-955  {
                line-height: 45px;
            }

            #menuA_wrap a, #menuB_wrap a{
                background: transparent url(img/lunch.png) no-repeat left 20%;
            }
            #menuA_wrap a{
                background-position: left 13%;
            }
            #guarniciones_wrap a {
                background: transparent url(img/soup.png) no-repeat  left 20%;
            }
            #menuC_wrap a {
                background: transparent url(img/lunch_optionb.png) no-repeat left 20%;
            }


            ul {list-style: none; padding: 0; margin: 0;}
            ul li {list-style: none;}        
            a{ text-decoration: none;}

            a:hover, a:active, .aside a:hover, .aside a:active {
                color: #1664A4;
                text-decoration: none;
            }
            a:active, .aside a:active {
                color:  #1BB7DF ; 
                text-decoration: none;
            }


            #fix {
                height: 1px;
                clear: both;
            }

            }

        </style>

        <script>
            function changeDivContent(myDiv,Content) // written by Nestor Benavidez
            {
                var div = document.getElementById(myDiv);
                switch (Content) 
                {
                    case "Search":
                        div.innerHTML = "<%= m.getPartialSearchHTML()%>";
                        break;
                    case "AddEmployee":
                        div.innerHTML = "<%= m.getPartialAddEmployeeHTML()%>";
                        break;
                    case "ImportCSV":
                        div.innerHTML = "<%= m.getPartialImportCSVHTML()%>";
                        break;
                    case "Report":
                        div.innerHTML = "<%= m.getPartialReportHTML(String.valueOf(me.getId_dept()))%>";
                        break;
                    }
                }
        </script>
    </head>
    <body>
        <div class="container">

            <div id="signup">
                <div class="top_left">
                    <img src="img/company.logo.19.jpg" alt="company logo"></img>
                </div>
                <div class="small_user_pic">
                    <a href="punchit.jsp"><img src="img/pics/<%= p%>" alt="pic" height="33" width="33"></img></a>
                    <a href="index.jsp"><img src="img/log-out.png" alt="sign out" height="33" width="33" > </img></a>
                </div>

                <div class="header">
                    <img src="img/logo.png" alt="logo"></img>
                </div>

                <div class="inputs">
                    <table width="100%">
                        <tr>
                            <td width="245px" style="vertical-align:top">
                                <div class="boxed-left">
                                    <div  id="tools_widget"  class="aside  tools_widget widgetcontainer">
                                        <h3 class="widgettitle"></h3> 
                                        <div class="menu-tools-container">
                                            <ul id="menu-tools" class="menu">
                                                <li id="menu-item-265" class="menu-item menu-item-type-custom menu-item-object-custom menu-item-265"><a href="edittimecards.jsp">Editar Ficha de Tiempo</a></li>
                                                <li id="menu-item-266" class="menu-item menu-item-type-custom menu-item-object-custom menu-item-266"><a href="unlock.jsp">Revisar Estados</a></li>
                                                <li id="menu-item-268" class="menu-item menu-item-type-custom menu-item-object-custom menu-item-268"><a href="#" onclick="changeDivContent( 'boxed-right', 'ImportCSV' )">Importar CSV</a></li>
                                                <li id="menu-item-955" class="menu-item menu-item-type-custom menu-item-object-custom menu-item-268"><a href="#" onclick="changeDivContent( 'boxed-right', 'Report' )">Reportes</a></li>
                                            </ul>
                                        </div>
                                        <div class="widget_footer"></div>
                                    </div>
                                </div>
                            </td>
                            <td style="vertical-align:top">
                                <div id="boxed-right" style="width:100%">
                                    <form action="#" method="GET">
                                        <div class="inputs">
                                            <br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br />
                                        </div>
                                    </form>
                                    <br />   

                                </div>
                            </td>
                        </tr>
                    </table>
                    <div id="fix"> </div>   
                </div>

            </div>
        </div>
    </body>
</html>
<%            } else {
            response.sendRedirect("punchit.jsp?last=mgrdash"); // Employee without MGR Privileges
            return;
        }
    } catch (Exception e) {
        response.sendRedirect("index.jsp?error=1&last=mgrdash"); // Anything goes bad, get credentials once again
        return;
    }
%>